package net.csdn.business.notify.handler.service.impl;

import lombok.RequiredArgsConstructor;
import net.csdn.business.notify.common.model.dto.UpdateNotifyRemindRecordDTO;
import net.csdn.business.notify.handler.service.INotifyAsyncService;
import net.csdn.business.notify.handler.service.INotifyRemindRecordService;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

/**
 * @Auther: zhangyalei
 * @Date: 2022/12/7 15:57
 * @Description:
 */
@Service
@RequiredArgsConstructor
public class NotifyAsyncServiceImpl implements INotifyAsyncService {

    private final INotifyRemindRecordService remindRecordService;
    private final ThreadPoolTaskExecutor taskExecutor;

    @Override
    public void updateSendStatusBatchAsync(UpdateNotifyRemindRecordDTO params) {
        taskExecutor.execute(()->{
            remindRecordService.updateSendStatusBatch(params);
        });
    }
}
